import { useI18n } from '@/hooks/web/useI18n'
import { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { reactive } from 'vue'
const { t } = useI18n()
export const permissionTableColumns = reactive<CrudSchema[]>([
  {
    field: 'id',
    label: t('restCommon.id')
  },
  {
    field: 'name',
    label: t('restCommon.name')
  },
  {
    field: 'resource',
    label: t('restPermission.resource')
  },
  {
    field: 'visibleStatus',
    label: t('restPermission.visibleStatus')
  },
  {
    field: 'component',
    label: t('restPermission.component')
  },
  {
    field: 'createdTime',
    label: t('restCommon.createdTime')
  },
  {
    field: 'updatedTime',
    label: t('restCommon.updatedTime')
  },
  {
    field: 'icon',
    label: t('restCommon.icon'),
    slots: {
      default: (data: any) => {
        const icon = data.row.icon
        if (icon) {
          return '<Icon icon={icon} />'
        } else {
          return null
        }
      }
    }
  },
  {
    field: 'action',
    width: '260px',
    label: t('tableDemo.action')
  }
])
